<?php

namespace App\Console;

use App\Console\Commands\Tasks\ActivityNewYearCommand;
use App\Console\Commands\Tasks\AutoSearchUserRegionCommand;
use App\Console\Commands\Tasks\Carnival2022Command;
use App\Console\Commands\Tasks\ClearCacheCommand;
use App\Console\Commands\Tasks\DynamicCommand;
use App\Console\Commands\Tasks\ExamineCommand;
use App\Console\Commands\Tasks\FixRoomPKCommand;
use App\Console\Commands\Tasks\GroupMemberNameCommand;
use App\Console\Commands\Tasks\Pet2022ActivityCommand;
use App\Console\Commands\Tasks\Rebuild\AccompanyOrderCommand;
use App\Console\Commands\Tasks\ScriptFix520GiveGiftCommand;
use App\Console\Commands\Tasks\RyBroadcastRetryCommand;
use App\Console\Commands\Tasks\ConnectOpenBoxCommand;
use App\Console\Commands\Tasks\ConnectPushCommand;
use App\Console\Commands\Tasks\ConnectReturnGift;
use App\Console\Commands\Tasks\PushThemeJoinUserNumberCommand;
use App\Console\Commands\Tasks\RefreshHotListCommand;
use App\Console\Commands\Tasks\OnlineUserComputeCommand;
use App\Console\Commands\Tasks\ScreenOpenCommand;
use App\Console\Commands\Tasks\ScriptFixBlindBoxExchangeCommand;
use App\Console\Commands\Tasks\ScriptFixRoomRankCommand;
use App\Console\Commands\Tasks\ScriptGiftWallCommand;
use App\Console\Commands\Tasks\ScriptPetSeasonCommand;
use App\Console\Commands\Tasks\StreamerTaskCommand;
use App\Console\Commands\Tasks\StreamerTaskOnlineStatCommand;
use App\Console\Commands\Tasks\TestCommand;
use App\Console\Commands\Tasks\XcxOrderQueryCommand;
use Illuminate\Console\Scheduling\Schedule;
use Laravel\Lumen\Console\Kernel as ConsoleKernel;
use App\Console\Commands\Tasks\Activity\LaborDay2023DateRewardsCommand;
use App\Console\Commands\Tasks\Activity\LaborDay2023OnlineTimeCommand;
use App\Console\Commands\Tasks\Activity\LaborDay2023OverallRewardsCommand;

class Kernel extends ConsoleKernel
{
    /**
     * The Artisan commands provided by your application.
     *
     * @var array
     */
    protected $commands = [
        Commands\Tasks\JoinNobilityCommand::class,  //金币日志判断开通爵位
        Commands\Tasks\CacheRecomCommand::class,    //缓存首页推荐页数据
        Commands\Tasks\IndexAdvertiseCommand::class,    //缓存首页广告数据
        Commands\Tasks\AutoVerifyCommand::class,    //自动审核用户资质
        Commands\Tasks\ClearOnlineCommand::class,   //清除用户在线时长缓存
//        Commands\Tasks\QueryAliAuthCommand::class,  //自动查询支付宝实名认证结果  未使用現在使用的是騰訊

        Commands\Tasks\CpapplyExpireCheckCommand::class,  //人脉CP申请过期检查
        Commands\Tasks\ConnectionIntimacyCommand::class,  //人脉语聊增加亲密度

        Commands\Tasks\WeekStarCommand::class, // 周星榜
        OnlineUserComputeCommand::class, // 计算当日在线用户
        PushThemeJoinUserNumberCommand::class, // 向客户端推送当前参与话题的人数
        RefreshHotListCommand::class, // 刷新热门推荐列表

        Commands\Tasks\Rebuild\DressCommand::class, // 检测用户个性商品过期时间
        Commands\Tasks\Rebuild\ProtectCommand::class, // 电台 守护 到期更新状态
        Commands\Tasks\Rebuild\GiftDayCommand::class, // 刷新房间流水数据
        Commands\Tasks\ActivityAutoOnlineCommand::class, // 根据配置自动上线活动
        Commands\Tasks\IdempotentDelete::class, // 定期删除幂等缓存的数据
        Commands\Tasks\IndexHotCommand::class,  //首页热点数据刷新
        Commands\Tasks\UserFootMarkCommand::class,  //定期同步足迹
        Commands\Tasks\PirateAutoIndependent::class,  //定期同步足迹
        Commands\Tasks\StreamerLevelCommand::class, // 认证主播每周定级

        ConnectOpenBoxCommand::class, //新人脉定期扫描未开启的盲盒
        ConnectPushCommand::class, // 定期推送未处理的申请
        ConnectReturnGift::class, // 定期返还未处理的商品到背包
        ExamineCommand::class, // 用户充值太过频繁报警
        ScreenOpenCommand::class,//我要上公屏开奖
        RyBroadcastRetryCommand::class,//融云广播失败重试
//        Carnival2022Command::class, //房间巅峰赛2024.1.9
        ScriptGiftWallCommand::class, // 修复礼物墙
        DynamicCommand::class, // 动态
        ScriptFixBlindBoxExchangeCommand::class, // 修复盲盒兑换
        ScriptPetSeasonCommand::class,
        ScriptFix520GiveGiftCommand::class, // 修复520送礼记录
        ScriptFixRoomRankCommand::class, //修复房间排行榜
        GroupMemberNameCommand::class, // 群成员昵称
        ClearCacheCommand::class, // 清除缓存
        TestCommand::class, // 调试用

        StreamerTaskCommand::class, // 主播任务
        StreamerTaskOnlineStatCommand::class,
        Pet2022ActivityCommand::class,
        FixRoomPKCommand::class,
        AutoSearchUserRegionCommand::class, // 自动寻找用户的所在地区
        AccompanyOrderCommand::class,//陪玩订单维护
        ActivityNewYearCommand::class,//元旦活动
        XcxOrderQueryCommand::class,//检查支付
//        LaborDay2023OnlineTimeCommand::class,
//        LaborDay2023OverallRewardsCommand::class,
//        LaborDay2023DateRewardsCommand::class,
    ];

    /**
     * Define the application's command schedule.
     *
     * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
     * @return void
     */
    protected function schedule(Schedule $schedule)
    {

//        $schedule->command('task:pet_2022_activity')->hourly();
        //缓存广告页数据
        $schedule->command('task:index_advertise')->everyMinute();

        //人脉CP绑定申请过期检查--一分钟一次
        $schedule->command('task:cpapplyExpireCheck')->everyMinute();
        //人脉语聊增加亲密度--一分钟一次
        $schedule->command('task:connectionIntimacy')->everyMinute();

        #爵位开通
        $schedule->command('task:joinNobility')->everyMinute();

//        $schedule->command('task:queryAliAuth')->everyMinute();

        //计算前一日在线用户树---一天一次(每天0点完成)
        $schedule->command('task:online-user-compute')->dailyAt('00:00');

        //向客户端推送当前参与话题的人数
        $schedule->command('task:push-theme-join-user-number')->everyMinute();

        //刷新热门推荐列表
        $schedule->command('task:refresh-hot-list')->everyFiveMinutes();

        //处理用户过期的个性物品
        $schedule->command('task:dress')->everyFiveMinutes();
        //电台 守护 到期更新状态
        $schedule->command('task:protect')->everyFiveMinutes();
        //刷新房间流水数据-每天0点执行
        $schedule->command('task:gift_day')->dailyAt('00:01');

        //10min清除一次幂等消费的zset的值防止堆积太多
        $schedule->command('task:idempotent_delete')->everyTenMinutes();

//        //定期同步足迹 暂时未用到 解决redis 慢查询
//        $schedule->command('task:user_footmark')->everyMinute();

        //每分钟检查60s之前的错误记录
        $schedule->command('task:connect_box')->everyMinute();

        //10min一次定期发送未接受申请的关系推送
        $schedule->command('task:connect_push')->everyTenMinutes();

        //每分钟执行
        $schedule->command('task:connect_return_gift')->everyMinute();

        //我要上公屏开奖

        //房间巅峰赛2024.1.9
//        $schedule->command('task:carnival2022')->everyMinute();

        // 动态
        $schedule->command((new DynamicCommand())->getSignature())->everyThirtyMinutes();
        // 交友群随机昵称
        $schedule->command((new GroupMemberNameCommand())->getSignature())->dailyAt('00:00');

        //海盗抽奖自动独立池子脚本
        $schedule->command('task:pirate_auto_independent')->everyMinute();

        //上周周榜数据入库 每周一四点开始
        $schedule->command('task:week_star')->weekly()->mondays()->at('04:00');

        //每周自动评级 每周一五点开始评级
        $schedule->command('task:streamer_week_level')->weekly()->mondays()->at('05:00');

        // 每天凌晨刷新主播任务
        $schedule->command((new StreamerTaskCommand())->getSignature())->dailyAt('00:00');
        $schedule->command((new StreamerTaskOnlineStatCommand())->getSignature())->everyFiveMinutes();

        //陪玩订单维护
        $schedule->command('task:accompany_order')->everyMinute();

        //每分钟执行
        $schedule->command('task:activity_new_year')->everyMinute();
        //每分钟执行
        $schedule->command('task:xcx_order_query')->everyMinute();

        //陪玩订单维护
//        $schedule->command('task:clean_public_room')->everyMinute();

//        $schedule->command((new LaborDay2023OnlineTimeCommand())->getSignature())->everyMinute();
//        $schedule->command((new LaborDay2023DateRewardsCommand())->getSignature())->dailyAt('00:00');
//        $schedule->command((new LaborDay2023OverallRewardsCommand())->getSignature())->dailyAt('00:00');
    }
}
